<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jquery-3.3.1.min.js"></script>
    <style>

        h1{text-align: center;}
        ul{margin: 0 auto; list-style: none; display: flex; flex-direction: column; width: 600px;}
        li{}
        input{width: 200px;}
    </style>
</head>
<body>
    <h1>测试回车极限录入jquery版</h1>
   <ul id="key">
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li> 
    <li><span>输入</span><input class="input"  /> <span>输入2</span><input class="input2"  /></li>  
   </ul>
<script>  
    var key = document.getElementById("key"); 
    key.onkeyup = f;  //注册keyup事件处理函数 
    function f (e) { 
        var e = e || window.event;  //标准化事件处理
        var s = e.type + " " + e.keyCode;  //获取键盘事件类型和按下的值
        // console.log("next..." ,s, $(e.target).attr("class"));
        if(e.keyCode == 13){
            key.value = s;
            if( $(e.target).attr("class")== "input"){ 
             let nextObj =  $(e.target).parent().next().find(".input:eq(0)");
             nextObj.focus();
            }else if( $(e.target).attr("class")== "input2"){ 
             let nextObj =  $(e.target).parent().next().find(".input2:eq(0)");
             nextObj.focus();
            } 
        }
    }
</script>

</body>



</html>